package com.zmcn.fileTransfer.fw.util;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
 * 获取配置文件
 * 
 * @author 欧建东
 * @email oyjd@163.com
 * 
 */
public class PropUtil {

	/**
	 * 获取配置文件
	 * 
	 * @return
	 */
	public static Map<String, String> read() {
		Map<String, String> map = new HashMap<String, String>();
		try {
			Properties p = new Properties();
			InputStream in = PropUtil.class.getResourceAsStream("/application.properties");
			p.load(in);
			for (Object key : p.keySet()) {
				String value = p.getProperty((String) key);
				map.put((String) key, value);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}
	
	public static void main(String[] args) {
		System.out.println(read());
	}
}
